home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-26 | 1015 b | 38 lines | [TEXT/MMCC] |
- // ===========================================================================
- // SCFinderUtility.h
- // ===========================================================================
- // © 1995 James Kaput, Jeremy Roschelle SimCalc Project
-
- #pragma once
-
- class UFinder {
- public:
-
- // gets the FSSpec of the application file (that we launched from)
- static void GetAppSpec(FSSpec &inSpec);
-
- // note: returns 0 if not a folder
- static long GetFolderID(FSSpec &inParentFolder, Str255 inName);
-
- // converts a TEXT handle into a Str255
- static inline void Handle2PStr(Handle inText, Str255 inString)
- {
- Int32 len = ::GetHandleSize(inText);
- if (len > 255) len = 255;
- inString[0] = len;
- ::BlockMoveData(*inText,&inString[1],len);
- }
-
- // ask the finder to open a file
- static OSErr SendFinderAEOpen(FSSpec &inFile);
- };
-
- class StFolderIterator {
- public:
- StFolderIterator(short inVRefNum, long inFolderID);
- Boolean Next(HFileParam &ioRec);
- private:
- short mVRefNum,
- mIndex;
- long mFolderID;
- };